/**
 * 游戏规则页面
 */
var ruleUI = function() {
    var self = this;
    self.container = null;
    self.game = null;
    self.mobile = false;
};
ruleUI.prototype = {};

ruleUI.prototype.init = function() {
    var self = this;
    if (self.bocai) {
        if (self.mobile) self.container.append('<div class="detail2"></div>');
        else
            self.container.append('<div class="detail"></div>');
        self.container.append('<div class="common"></div>');
    }
    else {
        self.container.append('<div class="common"></div>');
        if (self.mobile) self.container.append('<div class="detail2"></div>');
        else
            self.container.append('<div class="detail"></div>');
    }

    var game = self.game;
    if (!game) game = urlInfo.params.game || "bjpk10";
    
    startLoading();
    self.loadRule("common", self.container.find(".common"));
    self.loadRule(game, self.container.find(self.mobile ? ".detail2" : ".detail"));
}

ruleUI.prototype.loadRule = function(file, container) {
    var self = this;
    $.get("../public/all/pages/rule/rule_" + file + ".html", function(r) {
        stopLoading();
        container.empty();
        container.html(r);
    });
}

window.RuleUI = new ruleUI;